package cmd

import (
	"errors"

	"math-clc/enum"
	"math-clc/tool"

	"github.com/spf13/cobra"
)

var (
	parseHandling int
)

var rootCmd = &cobra.Command{
	Use:   "math-clc",
	Short: "Math calc the accumulative result.",
	Run: func(cmd *cobra.Command, args []string) {
		tool.Error(cmd, args, errors.New("unrecognized subcommand"))
	},
}

func init() {
	rootCmd.PersistentFlags().IntVarP(&parseHandling, "parse_error", "p", int(enum.ContinueOnParseError), "do what when parse arg error")
}

func Execute() {
	rootCmd.Execute()
}
